#include <iostream>
#include <cstdio>
typedef long long ll;
using namespace std;
int ex_gcd(ll a, ll b, ll &x,ll &y) {
    if (b==0) {
        x=1;
        y=0;
        return a;
    }
    ll ans=ex_gcd(b, a%b, x, y);
    ll tmp=x;
    x=y;
    y=tmp-a/b*y;
    return ans;
}
int cal(ll a, ll b) {
    ll x, y;
    ll gcd=ex_gcd(a, b, x, y);
    if (1%gcd!=0) return -1;
    x*=1/gcd;
    if (b<0) b=-b;
    ll ans=x%b;
    if (ans<=0) ans+=b;
    return ans;
}
int main() {
    ll a, b;
    while (cin>>a>>b) {
        ll ans=cal(a,b);
        if (ans==-1) cout<<"sorry"<<endl;
        else {
            cout<<ans<<' '<<(1-ans*a)/b<<endl;
        }
    }
    return 0;
}
